/**
 * 
 */
package com.disys.facade;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import com.disys.dao.LdapUsersDAO;
import com.disys.dao.Rec295DAO;
import com.disys.model.LdapUsers;
import com.disys.model.Rec140ERWOTCLOC;
import com.disys.model.Rec220emplpaydtl;
import com.disys.model.Rec295EmpPayCheck;

/**
 * @author Ubaid Raja
 * 
 */
public class Rec295Facade {
	private Rec295DAO obj = new Rec295DAO();

	public List<Rec295EmpPayCheck> findAllRecords() {
		List<Rec295EmpPayCheck> list = null;
		try {
			obj.beginTransaction();
			list = obj.findAll();
			obj.closeTransaction();
		} catch (IllegalStateException ex) {
			list = obj.findAll();
			obj.closeTransaction();
		}
		if (list.size() == 0 || list == null) {
			return new ArrayList<Rec295EmpPayCheck>();
		}
		return list;
	}

	public List<Rec295EmpPayCheck> findFinalizeRecords(String object,
			Integer isFinalized, BigInteger pId) {
		// obj.beginTransaction();
		List<Rec295EmpPayCheck> list = obj.findFinalizeRecords(object,
				isFinalized,pId);
		// obj.closeTransaction();
		if (list.size() == 0 || list == null) {
			return new ArrayList<Rec295EmpPayCheck>();
		}
		return list;
	}
	
	public List<Integer> getAllProcessIds(String object) {
		obj.beginTransaction();
		List<Integer> list = obj.getAllProcessIds(object);
		obj.closeTransaction();
		return list;
	}
}
